﻿using Chat.Common;
public class RcvMsgHandleFactory
{
    /// <summary>
    /// 数据处理工厂,返回处理接口
    /// </summary>
    /// <param name="cmdType">命令类型:Control、Chat</param>
    /// <returns></returns>
    public static IHandleable Create(string cmdType)
    {
        if (string.Compare(cmdType,CommandType.Control.ToString() , true) == 0)
            return new CtlMsgHandle();
        else if (string.Compare(cmdType, CommandType.Chat.ToString(), true) == 0)
            return new ChatMsgHandle();
        else
            return new UnknownHandle();
    }
}
